#include<bits/stdc++.h>
using namespace std;

void fun(string s)
{
	int c = 1189, d = 841;
	switch(s[1])
	{
	    case '0':cout<<c<<endl<<d;break;
	    case '1':cout<<d<<endl<<c/2;break;
	    case '2':cout<<c/2<<endl<<d/2;break;
	    case '3':cout<<d/2<<endl<<c/2/2;break;
	    case '4':cout<<c/2/2<<endl<<d/2/2;break;
	    case '5':cout<<d/2/2<<endl<<c/2/2/2;break;
	    case '6':cout<<c/2/2/2<<endl<<d/2/2/2;break;
	    case '7':cout<<d/2/2/2<<endl<<c/2/2/2/2;break;
	    case '8':cout<<c/2/2/2/2<<endl<<d/2/2/2/2;break;
	    case '9':cout<<d/2/2/2/2<<endl<<c/2/2/2/2/2;break;
	}
}

int main()
{
	string s;
	cin>>s;
	fun(s);
	return 0;
}

